<?php

namespace App\Http\Resources\V1;

use Illuminate\Http\Resources\Json\JsonResource;

class ArticleReplyResource extends JsonResource
{
    public function toArray($request)
    {
        $data = [
            'id'    => $this->id,
            'content'       => $this->content,
            'created_at'    => $this->created_at->toDateTimeString(),
        ];

        $data['user'] = new UserResource($this->whenLoaded('user'));

        return $data;
    }
}
